<?php
/**
 * Created by PhpStorm.
 * User: changshuiwang
 * Date: 2016/7/8
 * Time: 15:34
 */
namespace common\models;

use Yii;
use yii\base\Model;

/**
 * Login form
 */
class SearchForm extends Model
{
    public $username;
    public $score;
    public $tag;

    private $_user;


    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [

        ];
    }

    /**
     * Logs in a user using the provided username and password.
     *
     * @return boolean whether the user is logged in successfully
     */
    public function search()
    {
        
    }

    /**
     * Finds user by [[username]]
     *
     * @return User|null
     */
    protected function getUser()
    {
        if ($this->_user === null) {
            $this->_user = User::findByUsername($this->username);
        }

        return $this->_user;
    }
}
